package com.study.design.pattern.pattern.structural.decorator;

/**
 * @Author: gongsl
 * @Date: 2025-03-09 14:36
 * @description:
 */
public class Test {
    public static void main(String[] args) throws Exception {
        // 默认的煎饼
        AbsBatterCake batterCake = new BatterCake();
        // 加了一个鸡蛋
        batterCake = new EggDecorator(batterCake);
        // 又加了一个鸡蛋
        batterCake = new EggDecorator(batterCake);
        // 又加了一个香肠
        batterCake = new SausageDecorator(batterCake);
        System.out.println(batterCake.getDesc() + ", 价格：" + batterCake.cost());
    }
}
